package com.qp.bookkeeping.business.book.mapper;

import com.qp.bookkeeping.business.book.model.Bo.QueryBookBo;
import com.qp.bookkeeping.business.book.model.Bo.StatisticMonthBo;
import com.qp.bookkeeping.business.book.model.Do.BookDo;
import com.qp.bookkeeping.business.book.model.Dto.BookDto;
import com.qp.bookkeeping.business.book.model.req.QueryBookReq;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author xutianqi
 */
@Mapper
public interface BookMapper {
    /**
     * 插入收入
     *
     * @param bookDo 账本对象
     */
    public void insertIncome(BookDo bookDo);


    /**
     * 插入支出
     *
     * @param bookDo 账本对象
     */
    public void insertExpenditure(BookDo bookDo);

    /**
     * 查询所有账本
     *
     * @param queryBookReq 账本请求
     */
    public List<QueryBookBo> selectAllBook(QueryBookReq queryBookReq);

    /**
     * 查询收入账本
     *
     * @param queryBookReq 账本请求
     */
    public List<QueryBookBo> selectIncome(QueryBookReq queryBookReq);

    /**
     * 查询收入账本
     *
     * @param queryBookReq 账本请求
     */
    public List<QueryBookBo> selectExpenditure(QueryBookReq queryBookReq);

    /**
     * 更新收入表
     *
     * @param bookDto 账本对象
     */
    void updateIncome(BookDto bookDto);

    /**
     * 更新支出表
     *
     * @param bookDto 账本对象
     */
    void updateExpenditure(BookDto bookDto);

    List<StatisticMonthBo> statisticMonth(BookDto bookDto);

    /**
     * 根据id删除收入记录
     * @param bookDto 必填id
     */
    void deleteIncomeById(BookDto bookDto);
    /**
     * 根据id删除收入记录
     * @param bookDto 必填id
     */
    void deleteExpenditureById(BookDto bookDto);
}
